{% extends "menu.html" %}
{% block content %}

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">



            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>新增服务商key </h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post">
                        {% csrf_token %}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">功能名 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="cdn_name">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">SecretId <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="last-name" name="secretId" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">secretKey<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="secretKey" required>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">平台账户id<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="account_id" placeholder="可为空" value="0">
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">平台登录账户<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="account" placeholder="可为空" value="0">
                        </div>
                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">标示符<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="identifier"  placeholder="用于区分相同服务商不同账户信息" required>
                        </div>

                      </div>
                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">服务商<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select name="cdn_type" class="col-md-6 col-sm-6 col-xs-12" size="10" required>
                              {% for type in cdn_type %}
                              <option value ="{{ type.id }}">{{ type.name }}</option>
                              {% endfor %}

                          </select>
                        </div>
                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">所属项目<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select name="cdn_project" class="col-md-6 col-sm-6 col-xs-12" size="10" required>
                              {% for project in cdn_project %}
                              <option value ="{{ project.id }}">{{ project.p_name }}</option>
                              {% endfor %}

                          </select>
                        </div>

                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">是否支持CDN<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 8px">
                          是:
                        <input type="radio" class="flat" name="cdn_status" id="genderM" value="1"  required />
                            否:
                        <input type="radio" class="flat" name="cdn_status" id="genderF" value="0" checked="" />
                        </div>

                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">是否支持云平台<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 8px">
                          是:
                        <input type="radio" class="flat" name="cloud_status" id="genderX" value="1"  required checked="" />
                            否:
                        <input type="radio" class="flat" name="cloud_status" id="genderT" value="0"  />
                        </div>

                      </div>

                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">提示<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 6px">
                          帝联用户名对应Secretid，加密后的密码对应secretKey
                        </div>
                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">描述<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <textarea id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="description" placeholder="可为空" value="0"></textarea>
                        </div>
                      </div>
                        <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <span>{{ result }}</span>
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button class="btn btn-primary" type="button">Cancel</button>
						  <button class="btn btn-primary" type="reset">Reset</button>
                          <button type="submit" class="btn btn-success">Submit</button>
                        </div>
                      </div>

                    </form>
                  </div>
                  <table class="sui-table table-bordered">
                      <thead>
                        <tr>
                          <th>key_id</th>
                            <th>name</th>
                            <th>所属平台</th>
                            <th>标示符</th>
                          <th>管理</th>
                        </tr>
                      </thead>
                      <tbody>
                      {% for key in key_list %}
                        <tr>
                          <td>{{ key.id }}</td>
                            <td>{{ key.cdn_name }}</td>
                            <td>{{ key.cdn_type__name }}</td>
                            <td>{{ key.identifier }}</td>
                          <td><a href="/cdnadmin/add/?del={{ key.id }}">删除</a> </td>
                        </tr>
                      {% endfor %}

                      </tbody>
                    </table>
                </div>

              </div>

            </div>



          </div>
        </div>
{% endblock %}